package io.renren.modules.generator.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import io.renren.common.vo.OrderAddressesVo;
import io.renren.common.vo.TmsOrderVo;
import io.renren.modules.generator.entity.OrdersEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-11-16 11:05:22
 */
@Mapper
public interface OrdersDao extends BaseMapper<OrdersEntity> {

    List<OrdersEntity> queryPage(Map<String, Object> params);

    int queryPageTotal(Map<String, Object> params);



    List<OrderAddressesVo> queryAllFromAddressAndAllToAddress();

    void updateOrderStatusByIds(@Param("status") String status, @Param("ids") Collection<Integer> ids);


    void orderGroupOptionByIds(@Param("status") String status, @Param("orderIds") Collection<Integer> orderIds, @Param("orderGroupId") Integer orderGroupId);


    void updateOrderStatusById(@Param("status") String status, @Param("id") Integer id);


    void cancelOrderGroupByOrderGroupId(@Param("orderGroupId") int orderGroupId);

    OrdersEntity queryByOrderDetailIdAndOrderId(@Param("orderId") String orderId, @Param("orderDetailId") String orderDetailId);

    List<OrdersEntity> queryOrder(@Param("status") String status, @Param("orderGroupNumber") String orderGroupNumber, @Param("toAddressIds") Set<String> toAddressIds);

    List<OrdersEntity> queryOrdersByOrderGroupId(@Param("orderGroupId") int orderGroupId);

    Set<Map<String, String>> queryToDtAreaIdsByOrderIds(@Param("orderIds") Collection<Integer> orderIds);

    List<TmsOrderVo> queryTmsImportData(Map<String, Object> params);

    int queryTmsImportDataTotal(Map<String, Object> params);
}
